<template>
  <!-- 我的爱车-->
  <page-loading :show="showPage">
  <view class="container">
    <u-toast ref="uToast" />
    <view class="content" v-for="(item,index) in mycarlist" :key="index">
      <view class="carboxas flex flex-ai-c flex-jc-sb">
        <view class="flex flex-jc-c flex-ai-c mt-10" @click="mycarinf(item.id,index,item)">
          <view class="caimgs">
            <image :src="'https://files.yzsheng.com/goodimg/brandimg/'+item.brand_Id+'.png'" mode="aspectFit"></image>
          </view>
          <view class="cartexts">
            <view class="carnamews">
              {{item.brand_Name}}-{{item.car_Type_Name}}
            </view>
            <view class="font-28 color-666 mt-15">
              {{item.car_Name}}
            </view>
          </view>
        </view>
        <view style="">
          <view class="deleticon" @click="deleteClick(item.id)">
            <i-icon icon="iconchacha" type="single" size="34rpx" color="#b7b7b7"></i-icon>
          </view>
          <view class="default mr-20" v-if="item.defaultCar">
            默认
          </view>
          <view class="setdefault mr-20" v-else @click="setdefauleClick(item.id)">
            设为默认
          </view>
          <view class="font-24 color-666 mr-20" style="text-align:center;margin-top: 14rpx;">
            {{item.car_Num}}
          </view>
        </view>
      </view>
    </view>
    <view class="lodding">
      <u-loading mode="flower" :show="flowershow" size="50"></u-loading>
    </view>
    <!-- 默认图 -->
    <defaultImg :show="defaultImg" msg="暂无爱车,快去添加吧"></defaultImg>

    <view class="btns flex flex-jc-c flex-ai-c" @click="addlovecar" v-if="carnumber < 5">
      <view class="btnicon">
        <i-icon icon="icon-tainjia" type="single" size="44rpx" color="#3D3D3D"></i-icon>
      </view>
      <view class="btnname ml-15">
        添加爱车
      </view>
    </view>
  
		<u-modal v-model="isWelfare" :show-title="false" :mask-close-able="true" :show-confirm-button="false">
			<view class="model">
				<view class="model-title">温馨提示	</view>
				<view class="model-title-main">
					您购买的【{{welfareTitle}}】将绑定<br/>
					车牌号为：<text style="font-weight: bold;">{{carInfo.car_Num}}</text><br/>
					{{carInfo.brand_Name}} {{carInfo.car_Name}}<br/>
					绑定不可更改
				</view>
				<view class="model-btn flex flex-jc-c">
					<view class="model-btn-cancel" @click="isWelfare = false">取消</view>
					<view class="model-btn-confirm" @click="couponBindingCar">确定</view>
				</view>
			</view>
		</u-modal>
	</view>
  </page-loading>
</template>

<script src="./myLoveCar.js"></script>
<style scoped lang="scss">
  @import './myLoveCar.scss';
</style>
